package Vpackage;

import java.util.Scanner;

public class Main
{
    public static void main(String[] args)
    {
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt(); // 输入数据的组数

        for (int i = 0; i < N; i++)
        {
            String type = scanner.next(); // 图形类型
            IComVolume icv;

            if (type.equals("c"))
            { // 圆柱体
                double r = scanner.nextDouble();
                double h = scanner.nextDouble();
                icv = new Cylinder(r, h);
                System.out.printf("Cylinder: %.2f\n", icv.computeVolume());
            }
            else if (type.equals("b"))
            { // 长方体
                double a = scanner.nextDouble();
                double b = scanner.nextDouble();
                double c = scanner.nextDouble();
                icv = new Block(a, b, c);
                System.out.printf("Block: %.2f\n", icv.computeVolume());
            }
            else
            {
                System.out.println("未知的图形类型");
                continue;
            }

        }

        scanner.close();
    }
}